home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: rgfx 1.1 (26.11.97)
- **
- ** Specs and structure definitions for the IFF-RGFX file format -
- **
- ** (C) Copyright 1997 Andreas R. Kleinert
- ** Freeware. All Rights Reserved.
- */
-
- #ifndef RGFX_H
- #define RGFX_H
-
- #ifndef EXEC_TYPES_H
- #include <exec/types.h>
- #endif /* EXEC_TYPES_H */
-
- #ifndef LIBARIES_IFFPARSE_H
- #include <libraries/iffparse.h>
- #endif /* LIBARIES_IFFPARSE_H */
-
-
- /* *************************************************** */
- /* * * */
- /* * IFF/RGFX specific definitions and declarations * */
- /* * * */
- /* *************************************************** */
-
- #define ID_FORM MAKE_ID('F','O','R','M') /* if not already defined */
- #define ID_RGFX MAKE_ID('R','G','F','X') /* IFF-RGFX */
-
- /* A typical structure of a RGFX file (recommended) :
-
- FORM-RGFX
-
- RGHD
- RSCM
- RCOL
- RBOD
- */
-
-
- /*******************************************************
- RGHD - RawGfx Bitmap Header
-
- ** This one replaces BMHD
-
- */
-
- #define ID_RGHD MAKE_ID('R','G','H','D')
-
- struct RGHD
- {
- ULONG rgfx_LeftEdge; /* (see BMHD) */
- ULONG rgfx_TopEdge; /* (see BMHD) */
- ULONG rgfx_Width; /* (see BMHD) */
- ULONG rgfx_Height; /* (see BMHD) */
- ULONG rgfx_PageWidth; /* (see BMHD) */
- ULONG rgfx_PageHeight; /* (see BMHD) */
-
- ULONG rgfx_Depth; /* 1-8 for RMBT_BYTEPLANAR8,
- 1-8 for RMBT_BYTECHUNKY8,
- 24 for RMBT_3BYTERGB24 */
- ULONG rgfx_PixelBits; /* 1-8 for RMBT_BYTEPLANAR8,
- 8 for RMBT_BYTECHUNKY8,
- 24 for RMBT_3BYTERGB24 */
- ULONG rgfx_BytesPerLine; /* (width+7)/8 for RMBT_BYTEPLANAR8,
- width for RMBT_BYTECHUNKY8,
- width*3 for RMBT_3BYTERGB24 */
-
- ULONG rgfx_Compression; /* RCMP_ type flag */
- ULONG rgfx_XAspect; /* (see BMHD) */
- ULONG rgfx_YAspect; /* (see BMHD) */
- ULONG rgfx_BitMapType; /* RBMT_ type flag */
- };
-
- /* if you encounter unknown depth/pixelbits/bytesperline combinations,
- then do reject these (future expansions). But so far, only use
- the legal, defines ones yourself ! Don't define own formats,
- e.g. for 16 Bit or for BGR !
- */
-
- #define RCMT_NOCOMPRESSION (0L)
- #define RCMT_XPK (1L)
-
- #define RMBT_BYTEPLANAR8 (0L) /* unaligned planar 8 bit bitmap */
- #define RMBT_BYTECHUNKY8 (1L) /* unaligned chunky 8 bit bitmap */
- #define RMBT_3BYTERGB24 (2L) /* 3-byte 24 bit RGB triples */
- /* ***************************************************** */
-
-
- /*******************************************************
- RSCM - RawGfx ScreenMode
-
- ** This one replaces CAMG.
-
- The default setting is:
-
- rscm_AGA: default screenmode
- rscm_CGfx: INVALID_ID
- rscm_P96: INVALID_ID
-
- if ModeNotAvailable( rscm_P96 ) does return an error,
- then try ModeNotAvailable( rscm_CGfx ) - on error,
- then try ModeNotAvailable( rscm_AGA ).
-
- Use the first ID, which is available, otherwise compute
- one yourself by using BestModeID()
- */
-
- #define ID_RSCM MAKE_ID('R','S','C','M')
-
- struct RSCM
- {
- ULONG rscm_AGA; /* 32 Bit AGA Viewmode ID */
- ULONG rscm_CGfx; /* 32 Bit CGfx Viewmode ID */
- ULONG rscm_P96; /* 32 Bit P96 Viewmode ID */
- };
- /* ***************************************************** */
-
-
- /*******************************************************
- RCOL - RawGfx Colormap
-
- ** This one replaces CMAP,
-
- Required with RMBT_BYTEPLANAR8 and RMBT_BYTECHUNKY8,
- and optionally allowed with RMBT_3BYTERGB24 for use
- as a dithering destination colormap.
-
- Stored are 256 byte triples in RGB format. Note, that
- full-range values (0..255) have to be stored.
-
- Sample: rcol_Colors[0][0] = 0..255 red value, color #0 (1st)
- rcol_Colors[0][1] = 0..255 green value, color #0
- rcol_Colors[0][2] = 0..255 blue value, color #0
- ...
- rcol_Colors[255][0] = 0..255 red value, color #255 (256th)
- rcol_Colors[255][1] = 0..255 green value, color #255
- rcol_Colors[255][2] = 0..255 blue value, color #255
-
-
- Unused entries should be filled with zeroes.
- */
-
- #define ID_RCOL MAKE_ID('R','C','O','L')
-
- struct RCOL
- {
- ULONG rcol_TransColor; /* boolean: is there a transparent color ? */
- ULONG rcol_TransColorNum; /* yes, it's number ... from the ones below */
- UBYTE rcol_Colors[256][3];
- };
- /* ***************************************************** */
-
-
- /*******************************************************
- RBOD - RawGfx Bitmap Body
-
- ** This one replaces BODY
- */
-
- #define ID_RBOD MAKE_ID('R','B','O','D')
-
- /* May look like:
-
- struct RBOD
- {
- UBYTE rbod_XPK[3]; ** containing 'XPK'
- UBYTE rbod_BitMap[];
- };
-
- Or simply:
-
- struct RBOD
- {
- UBYTE rbod_BitMap[];
- };
-
- This has not been defined as a union structure here, since some
- compilers might add unwished pad bytes to the structure.
-
- You should reference this chunk as an UBYTE array, only.
-
- ******************************************************* */
-
-
- /*******************************************************
- RGFX - Other chunks
-
- - NAME, AUTH, ANNO and (C) chunks are allowed
- -
- ******************************************************** */
-
- #endif /* RGFX_H */
-